package org.dgt.service.api;

import java.util.List;
import org.dgt.model.core.UserInformation;

/**
 * @author TinNguyen
 * 
 */
public interface UserService {

	/**
	 * @param userId
	 * @return
	 */
	public UserInformation getUserById(Long userId);

	/**
	 * Register product user want to sell, it include product's price, quantity. 
	 * @param userId
	 * @param productId
	 * @param price
	 * @param quantity
	 * @return true if register success else false
	 */
	public boolean registerProductToSell(Long userId, Long productId, float price, int quantity, String notification);
	
	/**
	 * Get all products & its price & its quantity that had been registered to sell by the userId
	 * @param userId
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public List getRegisterProductsToSell(Long userId);
	
	/**
	 * Register product user want to buy, it include product's price, quantity. 
	 * @param userId
	 * @param productId
	 * @param price
	 * @param quantity
	 * @return true if register success else false
	 */
	public boolean registerProductToBuy(Long userId, Long productId, float price, int quantity);
	
	/**
	 * Get all products & its price & its quantity that had been registered to buy by the userId  
	 * @param userId
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public List getRegisterProductsToBuy(Long userId);
	
	/**
	 * @param userId
	 * @param productId
	 * @param newPrice
	 * @return
	 */
	public boolean updatePriceToSell(Long userId, Long productId, float newPrice);
	
	/**
	 * @param userId
	 * @param productId
	 * @param quantity
	 * @return
	 */
	public boolean updateQuantityToSell(Long userId, Long productId, int quantity);
	
	/**
	 * @param userId
	 * @param right
	 * @return
	 */
	public boolean isUserHaveRight(Long userId, String right);
	
	/**
	 * Check user was login or not
	 * @param userId
	 * @return
	 */
	public boolean isUserLogin(Long userId);
	
	/**
	 * @return
	 */
	public UserInformation getCurrentUser();
}
